#ifndef __SRAM__
#define __SRAM__

#include <inttypes.h>

#include "data-bus.h"

class SRam : public DataBusMember
{
public:
  SRam (uint16_t size, uint16_t address_base);
  ~SRam ();

  uint8_t operator[] (uint16_t address) const;
  uint8_t& operator[] (uint16_t address);

  void zero ();

  virtual uint8_t read (uint16_t address);
  virtual void write (uint16_t address, uint8_t data);

private:
  uint16_t _size;
  uint8_t *_data;
};

#endif /* __SRAM__ */
